package client.game;

import java.io.PrintWriter;

import shared.player.Player;

/**
 * The Class MessageSender
 * - used to send messages to the server.
 */
public class MessageSender{
	
	/** Traffic out. */
	PrintWriter netOut;
	
	/** The player object. */
	Player p;
	
	/**
	 * Instantiates a new message sender.
	 *
	 * @param netOut the traffic out
	 * @param p the player object
	 */
	public MessageSender(PrintWriter netOut, Player p){
		this.netOut = netOut;
		this.p = p;
	}
	
	/**
	 * Send ready message.
	 */
	public void sendReady(){
		netOut.println("READY");
		netOut.flush();
	}
	
	/**
	 * Send ack message.
	 */
	public void sendAck(){
		netOut.println("ACK " + p.direction);
		netOut.flush();
	}
}
